﻿using RecruitStudents.Client.BLL;
using RecruitStudents.Client.Loading;
using RecruitStudents.Utility;
using RecruitStudents.Utility.Helper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace RecruitStudents.Client.Examinee
{
    public partial class Examinee_ImportStudentsPhotoForm_List : BaseForm
    {
        ServiceExaminee service = new ServiceExaminee();
        public Examinee_ImportStudentsPhotoForm_List()
        {
            InitializeComponent();
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            this.folderBrowserDialog1.SelectedPath = "";
            this.folderBrowserDialog1.ShowDialog();
            this.txtPath.Text = folderBrowserDialog1.SelectedPath.Trim();
        }

        private void btnImport_Click(object sender, EventArgs e)
        {
            if (txtPath.Text.Trim() == "")
            {
                DevHelper.ShowInfoMessageBox("您还没有选择需要导入的文件!");
            }
            else
            {
                bool flag = false;
                flag = service.Getphoto(this.txtPath.Text.Trim());
                if (!flag)
                {
                    DevHelper.ShowErrorMessageBox("导入失败！");
                }
                else
                {
                    DevHelper.ShowInfoMessageBox("导入成功！");
                    this.Close();
                }
            }

        }
    }
}
